import functools


class Solution(object):
    def nthPersonGetsNthSeat(self, n):
        if n == 1:
            return 1
        else:
            def search(k):
                if k == 1:
                    return 1 / n
                if k == n:
                    return 1 - search(n - 1)
                return search(k - 1) * (1 + 1 / (n - k + 1))
        return search(n)

data = Solution()
n = 2
print(data.nthPersonGetsNthSeat(n))
